﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Linq;

namespace System.Windows.Media.DirectShow.Filters
{
    public class PinTee : BaseFilter
    {


        private int pinCount = 1;

        public PinTee()
        {
            this.Pins.Add(new PinTeeInputPin(this));
            AddNewOutputPin();
        }

        public override string Name
        {
            get { return "Infinite Pin Tee Filter"; }
        }

        internal void AddNewOutputPin()
        {
            PinTeeOutputPin p = new PinTeeOutputPin(this, pinCount++);

            // Use the same input media type 
            var l = this.Pins.OfType<PinTeeOutputPin>().ToArray();
            if (l.Length > 0)
                p.SetMediaTypes(l[0].MediaTypes.ToArray());
            this.Pins.Add(p);
        }
    }
}
